/*
 * =====================================================================================
 *
 *       Filename:  filesize.c
 *
 *    Description:  filesize
 *
 *        Version:  1.0
 *        Created:  2012年08月23日 18时17分04秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc,char *argv[])
{
	if(argc<2)
	{
		fprintf(stderr,"You must specify the calculate file \n");
		return -1;
	}

	int file=open(argv[1],O_RDONLY);

	printf("size of %s :%d \n",argv[1],lseek(file,0,SEEK_END));
	return 0;
}
